package com.donger.common.sso.config;

import cn.dev33.satoken.stp.StpUtil;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.context.annotation.Configuration;


/**
 * @author pmc
 */
@Configuration
public class FeignRequestInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate) {
        String tokenValue = StpUtil.getTokenValue();
        requestTemplate.header("saToken", tokenValue);
    }
}
